package com.example.stock.controller;

import com.example.stock.service.LevelPointService;
import com.example.stock.util.Result;
import com.example.stock.util.ResultGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin(origins = "*")
@RequestMapping("lp")
@RestController
public class LevelPointController {

    @Autowired
    LevelPointService levelPointService;

    @GetMapping("week")
    Result week(@RequestParam String week, @RequestParam int lp) {
        return ResultGenerator.genSuccessResult(levelPointService.getByWeekAndLp(week, lp));
    }
}
